#pragma once
#include "RBTree.h"

namespace my_map
{

	template<class K, class V>
	class map
	{
		struct MapKeyOfT
		{
			K& operator()(const pair<K, V>& kv)
			{
				return kv.first;
			}
		};

	public:
		typedef typename RBTree<K, pair<K,V>, MapKeyOfT>::Iterator iterator;

		iterator begin()
		{
			return _t.Begin();
		}

		iterator end()
		{
			return _t.End();
		}

		bool Insert(const pair<K, V>& kv)
		{
			return _t.Insert(kv);
		}
	private:
		RBTree<K, K, MapKeyOfT> _t;
	};
}
